<?php

namespace App\Models\Permission;

use Illuminate\Database\Eloquent\Model;
use App\Http\Traits\QueryHelperTrait;
use Illuminate\Database\Eloquent\SoftDeletes;

final class ModuleName {

    // invoice
    // payment
    // e-statement
    // recurring-job
    const accounting = 'accounting';

    const attendance = 'attendance'; // attendance, past-attendance

    const customer = 'customer'; // csv-import

    const event = 'event'; // event

    // horse
    // horse-lease
    // horse-lease-record
    // floating
    // dentist-record
    // farrier-record
    // worming-record
    // vaccination-record
    // dentist
    // farrier
    const horse = 'horse';

    const groom = 'groom'; // groom

    const instructor = 'instructor'; // instructor

    const lesson = 'lesson'; // lesson, lesson-instructor

    const setting = 'setting'; // setting

    const hrm = 'hrm'; // leave application

    const dailySheet = 'daily-sheet'; // daily-sheet

    const dashboard = 'dashboard'; // dashboard

    const user = 'user'; // user, role

    const rider = 'rider'; // rider

    const member = 'member'; // member

    const report = 'report'; // report
}

class Permission extends Model {

    use SoftDeletes, QueryHelperTrait;

    protected $fillable = [
        'module_name',
        'feature_name',
        'ability',
    ];

    public function roles() {
        return $this->hasMany(Role::class);
    }
}
